/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.springapp.service.impl;

import com.springapp.model.Animal;
import com.springapp.model.Type;
import com.springapp.repository.TypeRepository;
import com.springapp.service.TypeService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author Лерок
 */
@Service
public class TypeServiceImpl implements TypeService {
    
    @Autowired
    private TypeRepository tr;

    @Override
    public List<Type> getAll() {
        return (List<Type>) tr.findAll();
    }
    
    public void create(Type type) {
        tr.save(type);
    }
    
    public void delete(int id) {
        tr.delete(id);
    }
    
    public long count() {
        return tr.count();
    }
}
